#!/usr/bin/python

import  sys

for eachLine in sys.stdin:
    eachLine = eachLine.strip()
    cat_len = len(eachLine.split("\t")) -1
    print eachLine+"\t"+str(cat_len)+"\n"
